package com.sinosoft.oms.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sinosoft.oms.entity.oms.Appnt;
import com.sinosoft.oms.mapper.AppntMapper;
import com.sinosoft.oms.service.AppntService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author:Frankiegg
 * @date:2018/5/15
 * @project:bee
 * @Modified By:
 **/
@Service("DealAppnt")
public class AppntServiceImpl implements AppntService {
    @Autowired
    private AppntMapper appntMapper;

    @Override
    public PageInfo<Appnt> findAllAppnt(int currentPage, int pageSize) {
        PageHelper.startPage(currentPage, pageSize);
        List<Appnt> appnts = appntMapper.findAllAppnt();
        for(Appnt appnt:appnts){
            System.out.println(appnt);
        }
        PageInfo<Appnt> pageInfo = new PageInfo<>(appnts);
        return pageInfo;
    }
}
